package com.hzy.fivepalace.wx.controller.api;

import com.hzy.fivepalace.wx.controller.base.BaseController;
import com.hzy.fivepalace.wx.service.WxHomeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wx/home")
@Validated
@Api(tags = "首页服务")
public class WxHomeController extends BaseController {

    private static final Logger logger = LoggerFactory.getLogger(WxHomeController.class);

    @Autowired
    private WxHomeService homeService;


    /**
     * 首页模块商品
     *
     * @return
     */
    @GetMapping("/getHomeModuleGoods")
    @ApiOperation(value = "首页模块商品")
    public Object getHomeModuleGoods() {

        return homeService.getHomeModuleGoods();
    }



    /**
     * 首页模块拼团商品
     *
     * @return
     */
    @GetMapping("/getHomeGroups")
    @ApiOperation(value = "首页模块拼团商品")
    public Object getHomeGroups() {
        return homeService.getHomeGroupsGoods();
    }


    /**
     * 首页轮播图
     *
     * @return
     */
    @GetMapping("/getHomeSlideshow")
    @ApiOperation(value = "首页轮播图")
    public Object getHomeSlideshow() {

        return homeService.getHomeSlideshow();
    }

    /**
     * 品牌视频列表
     *
     * @param page
     * @param size
     * @return
     */
    @GetMapping("/getVideoList")
    @ApiOperation(value = "品牌视频列表")
    public Object getVideoList(
            @ApiParam(value = "页码", defaultValue = "1") @RequestParam(defaultValue = "1") Integer page,
            @ApiParam(value = "分页大小", defaultValue = "10") @RequestParam(defaultValue = "10") Integer size) {

        return homeService.getVideoList(page, size);
    }

    /**
     * 获取推荐视频
     *
     * @return
     */
    @GetMapping("/getRecommendVideo")
    @ApiOperation(value = "获取推荐视频")
    public Object getRecommendVideo() {

        return homeService.getRecommendVideo();
    }

    /**
     * 获取公告列表
     * @return
     */
    @GetMapping("/getNoticeList")
    @ApiOperation(value = "获取公告列表")
    public Object getNoticeList() {

        return homeService.getNoticeList();
    }

    /**
     * 获取首页热门推荐商品列表
     * @param page
     * @param size
     * @return
     */
    @GetMapping("/getHomeRecommendGoodsList")
    @ApiOperation(value = "获取首页热门推荐商品列表")
    public Object getHomeRecommendGoodsList(
            @ApiParam(value = "页码", defaultValue = "1") @RequestParam(defaultValue = "1") Integer page,
            @ApiParam(value = "分页大小", defaultValue = "10") @RequestParam(defaultValue = "10") Integer size) {

        return homeService.getHomeRecommendGoodsList(page, size);
    }
}
